<script setup>
import { ref } from 'vue'
const memberSearchData = ref({
  communityNumber:'',
  communityName:'',
  studentNumber:'',
  fullName:'',
})
const handlerSearch = () => {}
const handlerReset = () => {}
const tableData = [
  {
    id: 1,
    clubId: 'CLB001',
    clubName: '舞蹈社',
    studentId: 'S12345',
    name: '张伟',
    gender: '男',
    major: '舞蹈',
    admissionYear: '2015',
    faculty: '艺术学院',
    clubLeader: '李华',
  },
  {
    id: 2,
    clubId: 'CLB002',
    clubName: '篮球社',
    studentId: 'S12346',
    name: '李娜',
    gender: '女',
    major: '体育',
    admissionYear: '2016',
    faculty: '体育学院',
    clubLeader: '王强',
  },
  {
    id: 3,
    clubId: 'CLB003',
    clubName: '编程社',
    studentId: 'S12347',
    name: '刘洋',
    gender: '男',
    major: '计算机科学',
    admissionYear: '2017',
    faculty: '信息工程学院',
    clubLeader: '赵敏',
  },
  {
    id: 4,
    clubId: 'CLB004',
    clubName: '音乐社',
    studentId: 'S12348',
    name: '王丽',
    gender: '女',
    major: '音乐',
    admissionYear: '2018',
    faculty: '音乐学院',
    clubLeader: '陈刚',
  },
]

const handleClick = (row) => {
  console.log('click', row)
}
</script>

<template>
  <!-- 搜索 -->
  <div class="search_box">
    <el-card>
      <el-row :gutter="20">
        <el-col :span="5">
          <span>社团编号</span>
          <el-input v-model="memberSearchData.communityNumber" placeholder="请输入搜索用户账号"></el-input>
        </el-col>
        <el-col :span="5">
          <span>社团名称</span>
          <el-input v-model="memberSearchData.communityName" placeholder="请输入搜索用户名"></el-input>
        </el-col>
        <el-col :span="5">
          <span>学号</span>
          <el-input v-model="memberSearchData.studentNumber" placeholder="请输入搜索用户名"></el-input>
        </el-col>
        <el-col :span="5">
          <span>姓名</span>
          <el-input v-model="memberSearchData.fullName" placeholder="请输入搜索用姓名"></el-input>
        </el-col>
        <el-col :span="4">
          <el-button type="primary" @click="handlerSearch">搜索</el-button>
          <el-button @click="handlerReset">重置</el-button>
        </el-col>
      </el-row>
    </el-card>
  </div>
  <!-- 列表区域 -->
  <div class="list_box">
    <!-- 表格 -->
    <el-card class="box-card">
      <el-table size="large" :data="tableData" border style="width: 100%">
        <el-table-column prop="id" label="社团成员信息ID" width="180" />
        <el-table-column prop="clubId" label="社团编号" width="180" />
        <el-table-column prop="clubName" label="社团名称" width="180" />
        <el-table-column prop="studentId" label="学号" width="180" />
        <el-table-column prop="name" label="姓名" width="180" />
        <el-table-column prop="gender" label="性别" width="180" />
        <el-table-column prop="major" label="专业" width="180" />
        <el-table-column prop="admissionYear" label="入学年份" width="180" />
        <el-table-column prop="faculty" label="所属二级学院" width="180" />
        <el-table-column prop="clubLeader" label="社团团长" width="180" />
        <el-table-column fixed="right" label="Operations" width="120">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="handleClick(scope.row)">
              详情
            </el-button>
            <el-button link type="primary" size="small">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination-block">
        <el-pagination
            v-model:current-page="currentPage4"
            v-model:page-size="pageSize4"
            :page-sizes="[100, 200, 300, 400]"
            :size="size"
            :disabled="disabled"
            :background="background"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
        />
      </div>
    </el-card>
  </div>
</template>

<style scoped>
.box-card{
  position: relative;
  min-height: 78vh;
}
.list_box {
  margin: 20px 0;
}
.pagination-block{
  position: absolute;
  bottom: 3rem;
  left: 4rem;
  margin-top: 1rem;
}
.search_box {
  .el-col {
    display: flex;
    align-items: center;

    span {
      width: 120px;
      text-align: right;
      margin-right: 10px;
      text-wrap: nowrap;
    }
  }
}
</style>
